<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
	layout:decorator="v2/layout">
  <head>
    <title>欢迎进入管理系统</title>
    <script type="text/javascript" th:inline="javascript">
    	var photo = [[${data.photo}]];
    	var addressProvince = [[${data.addressProvince}]];
    	var addressCity = [[${data.addressCity}]];
    	var addressDistrict = [[${data.addressDistrict}]];
    	
    	var id = getParam("id", "");
    	$(function(){
    		
    		if(id){
    			setMenu("编辑子账号");	
    		} else {
    			setMenu("新建子账号");
    		}
    		
    		$("#area").jjarea({keys:["addressProvince","addressCity","addressDistrict"], values:[addressProvince, addressCity, addressDistrict]});
    		
    		var validator = $("#form").jjformValidator({url:'son-detailSave',success:function(ret){
    			location.href="son";
    		}});
    		validator.add("name", {min:2,max:40});
    		validator.add("photo", {min:1,errorMsg:"请上传头像"});
    		validator.add("realName", {min:2,max:40});
    		
    		$("#photo").jjUploadClipFile({width:150,height:150,isClip:true, url:(photo==""?null:photo)});
    		
    	});
    </script>
    <style>
    </style>
  </head>
  <body>
    <div layout:fragment="content">
		<div class="info info-full">
			<div class="detail-table">
				<div class="warning">
					<i class="icon-radio"></i>
					请您遵守国家相关规定，切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容，并对所发布负责，我要学保有依据国家规定及平台规则进行处理的权利。
				</div>
				
      			<h4 class="detail-table-title">
					<i class="title-before"></i>子账号信息
				</h4>
				<form id="form">
				<input type="hidden" name="id" th:value="${data.id}"/>
				<div class="form">
					
					<div class="form-item">
						<label class="form-title">头像 <span class="form-required">*</span></label>
						<div class="form-content">
								<div id="photo"></div>
							<div class="form-error" id="photoTip"></div>
						</div>
					</div>
					
					<div class="form-item">
						<label class="form-title">机构名称（展示） <span class="form-required">*</span></label>
						<div class="form-content">
							<input class="form-text" type="text" name="name" placeholder="" th:value="${data.name}"/>
							<div class="form-error" id="nameTip"></div>
						</div>
					</div>
					
					
					
					<div class="form-item">
						<label class="form-title">经营者姓名 <span class="form-required">*</span></label>
						<div class="form-content">
							<input class="form-text" type="text" name="realName" placeholder="" th:value="${data.realName}"/>
							<div class="form-error" id="realNameTip"></div>
						</div>
					</div>
					
					<div class="form-item">
						<label class="form-title">省市区</label>
						<div class="form-content">
							<div id="area"  class="form-text"></div>
							<div class="form-error"></div>
						</div>
					</div>
					
					<div class="form-item">
						<label class="form-title">地址</label>
						<div class="form-content">
							<input class="form-text" type="text" name="addressDetail" placeholder="" th:value="${data.addressDetail}"/>
							<div class="form-error" id="addressDetailTip"></div>
						</div>
					</div>
					
					
					<div class="form-item">
						<label class="form-title">备注（选填） <span class="form-required"></span></label>
						<div class="form-content">
							<input class="form-text" type="text" name="remarks" placeholder="" th:value="${data.remarks}"/>
							<div class="form-error" id="remarksTip"></div>
						</div>
					</div>
					
				</div>
				
				
				<div class="form">
					<div class="form-item">
						<label class="form-title"></label>
						<button class="form-submit">保存</button>
					</div>
				</div>
				</form>
          	</div>
			
    	</div>
    	
    </div>
  </body>
</html>